import React from "react";
import {
  BrowserRouter as Router,
  Redirect,
  Route,
  Switch,
} from "react-router-dom";
import Login from "./pages/Login/index";
import Layout from "./pages/Layout/index";

export default class App extends React.Component {
  render() {
    return (
      <Router>
          {/* 配置路由规则和组件 */}
        <Switch>
          {/* 重定项,设置默认开始页面 */}
          <Redirect from="/" to="/Layout" exact></Redirect>
          <Route path="/Layout" component={Layout}></Route>
          <Route path="/Login" component={Login}></Route>
        </Switch>
      </Router>
    );
  }
}
